home *** CD-ROM | disk | FTP | other *** search
/ InterCD 2001 March / march_2001.iso / intercd / root / Tools / ^Groove / setup.exe / Disk1 / data1.cab / Data_Files / clean.bat next >
Encoding:
DOS Batch File  |  2001-01-02  |  6.0 KB  |  150 lines

  1. @echo off
  2.  
  3. Mutex /o clean.lock
  4. if errorlevel 1 goto errorlocked
  5.  
  6. @if "doit%1" == "doitall" goto doitall
  7. @if "doit%1" == "doitAll" goto doitall
  8. @if "doit%1" == "doitALL" goto doitall
  9.  
  10. if exist groovecmxmit.xss del groovecmxmit.xss >NUL
  11. if exist groovecmxmit_xss.log del groovecmxmit_xss.log >NUL
  12.  
  13. if exist groovecmrecv.xss del groovecmrecv.xss >NUL
  14. if exist groovecmrecv_xss.log del groovecmrecv_xss.log >NUL
  15.  
  16. if exist csm.xss del csm.xss >NUL
  17. if exist csm_xss.log del csm_xss.log >NUL
  18.  
  19. if exist groove.xss del groove.xss >NUL
  20. if exist groove_xss.log del groove_xss.log >NUL
  21.  
  22. if "%OS%" == "Windows_NT" if exist _SystemInstall_ rmdir /s /q _SystemInstall_ >NUL
  23. if NOT "%OS%" == "Windows_NT" deltree /y _SystemInstall_ >NUL
  24.  
  25. echo.
  26. echo Performed MINIMAL clean (Accounts not deleted)
  27. echo. | time | find /i "current"
  28. echo.
  29. Mutex /c clean.lock
  30. goto success
  31.  
  32. :doitall
  33.  
  34. if exist *.tsp del *.tsp >NUL
  35. if exist *.grv del *.grv >NUL
  36. if exist groovecmxmit.xml del groovecmxmit.xml >NUL
  37. if exist groovecmrecv.xml del groovecmrecv.xml >NUL
  38. if exist cmdebug.xml del cmdebug.xml >NUL
  39. if exist ram.xml del ram.xml >NUL
  40. if exist EventLog.xml del EventLog.xml >NUL
  41. if exist TransportCache.xml del TransportCache.xml >NUL
  42. if exist id.xml del id.xml >NUL
  43. if exist csmshared.xml del csmshared.xml >NUL
  44. if exist csmipc.* del csmipc.* >NUL
  45. if exist *.id del *.id >NUL
  46. if exist *.tmp del *.tmp >NUL
  47.  
  48. rem *** Clean up Account directories
  49. if "%OS%" == "Windows_NT" goto NTAccountClean
  50. deltree /y Accounts >NUL
  51. goto AccountCleanDone
  52.  
  53. :NTAccountClean
  54. if exist Accounts rmdir /s /q Accounts >NUL
  55.  
  56. :AccountCleanDone
  57.  
  58. rem *** Clean up directories
  59. if "%OS%" == "Windows_NT" goto NTCleanDirs
  60. deltree /y  groovecmxmit.xss_ >NUL
  61. deltree /y  groovecmrecv.xss_ >NUL
  62. deltree /y  csm.xss_ >NUL
  63. deltree /y  groove.xss_ >NUL
  64. deltree /y _SystemInstall_ >NUL
  65. goto CleanDirsDone
  66.  
  67. :NTCleanDirs
  68. if exist groovecmxmit.xss_ rmdir /s /q groovecmxmit.xss_ >NUL
  69. if exist groovecmrecv.xss_ rmdir /s /q groovecmrecv.xss_ >NUL
  70. if exist groove.xss_ rmdir /s /q groove.xss_ >NUL
  71. if exist _SystemInstall_ rmdir /s /q _SystemInstall_ >NUL
  72.  
  73. :CleanDirsDone
  74.  
  75. rem *** Make copies of the XSS files we want to preserve, giving them an XOS suffix
  76. rem *** so that we can use del *.xss (Unix 'find' would be nice here).
  77. rem *** Also copy the corresponding logs so that we don't get a lost log error.
  78. if exist *.xos del *.xos >NUL
  79. if exist *.xog del *.xog >NUL
  80. if exist schemas.xss copy schemas.xss schemas.xos >NUL
  81. if exist schemas_xss.log copy schemas_xss.log schemas_xss.xog >NUL
  82. if exist templates.xss copy templates.xss templates.xos >NUL
  83. if exist templates_xss.log copy templates_xss.log templates_xss.xog >NUL
  84. if exist securitytemplates.xss copy securitytemplates.xss securitytemplates.xos >NUL
  85. if exist securitytemplates_xss.log copy securitytemplates_xss.log securitytemplates_xss.xog >NUL
  86. if exist transformations.xss copy transformations.xss transformations.xos >NUL
  87. if exist transformations_xss.log copy transformations_xss.log transformations_xss.xog >NUL
  88. if exist themes.xss copy themes.xss themes.xos >NUL
  89. if exist themes_xss.log copy themes_xss.log themes_xss.xog >NUL
  90. if exist registries.xss copy registries.xss registries.xos >NUL
  91. if exist registries_xss.log copy registries_xss.log registries_xss.xog >NUL
  92. if exist osd.xss copy osd.xss osd.xos >NUL
  93. if exist osd_xss.log copy osd_xss.log osd_xss.xog >NUL
  94. if exist components.xss copy components.xss components.xos >NUL
  95. if exist components_xss.log copy components_xss.log components_xss.xog >NUL
  96. if exist offline.xss copy offline.xss offline.xos >NUL
  97. if exist offline_xss.log copy offline_xss.log offline_xss.xog >NUL
  98.  
  99. :Groove
  100. if exist *.xss del *.xss >NUL
  101. if exist *.log del *.log >NUL
  102.  
  103. :Share
  104. if not exist Share\NUL goto Final
  105. if not exist Share\* goto Share2
  106. echo Y | del Share\* >NUL
  107.  
  108. :Share2
  109. rmdir Share>NUL
  110.  
  111. :Final
  112. rem *** Rename the XOS files back to XSS files.  If someone was holding one of the
  113. rem *** XSS files open when we deleted *.xss, that file won't have been deleted, so
  114. rem *** test first.
  115. if exist schemas.xos if not exist schemas.xss ren schemas.xos schemas.xss
  116. if exist templates.xos if not exist templates.xss ren templates.xos templates.xss
  117. if exist securitytemplates.xos if not exist securitytemplates.xss ren securitytemplates.xos securitytemplates.xss
  118. if exist transformations.xos if not exist transformations.xss ren transformations.xos transformations.xss
  119. if exist themes.xos if not exist themes.xss ren themes.xos themes.xss
  120. if exist registries.xos if not exist registries.xss ren registries.xos registries.xss
  121. if exist osd.xos if not exist osd.xss ren osd.xos osd.xss
  122. if exist components.xos if not exist components.xss ren components.xos components.xss
  123. if exist offline.xos if not exist offline.xss ren offline.xos offline.xss
  124. if exist schemas_xss.xog if not exist schemas_xss.log ren schemas_xss.xog schemas_xss.log
  125. if exist templates_xss.xog if not exist templates_xss.log ren templates_xss.xog templates_xss.log
  126. if exist securitytemplates_xss.xog if not exist securitytemplates_xss.log ren securitytemplates_xss.xog securitytemplates_xss.log
  127. if exist transformations_xss.xog if not exist transformations_xss.log ren transformations_xss.xog transformations_xss.log
  128. if exist themes_xss.xog if not exist themes_xss.log ren themes_xss.xog themes_xss.log
  129. if exist registries_xss.xog if not exist registries_xss.log ren registries_xss.xog registries_xss.log
  130. if exist osd_xss.xog if not exist osd_xss.log ren osd_xss.xog osd_xss.log
  131. if exist components_xss.xog if not exist components_xss.log ren components_xss.xog components_xss.log
  132. if exist offline_xss.xog if not exist offline_xss.log ren offline_xss.xog offline_xss.log
  133.  
  134. rem *** Delete any XOS files left over (for which the XSS files were never deleted).
  135. if exist *.xos del *.xos >NUL
  136. if exist *.xog del *.xog >NUL
  137. echo.
  138. echo Performed COMPLETE clean (Accounts deleted)
  139. echo. | time | find /i "current"
  140. echo.
  141.  
  142. Mutex /c clean.lock
  143. goto success
  144.  
  145. :errorlocked
  146. echo Another clean is running.  Quitting.
  147. echo.
  148.  
  149. :success
  150.